<%--
  Created by IntelliJ IDEA.
  User: paul1
  Date: 2018/12/19
  Time: 9:48
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.Calendar" %><%--
  Created by IntelliJ IDEA.
  User: paul1
  Date: 2018/12/18
  Time: 14:00
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>发布公告</title>
</head>
<script type="text/javascript"  src="/static/layuiadmin/layui/layui.all.js"></script>
<script type="text/javascript"  src="/static/layuiadmin/layui/layui.js"></script>
<link href="/static/layuiadmin/layui/css/layui.css" rel="stylesheet">
<script src="/static/js/jquery-3.3.1.js"></script>

<body>
<form id="myform" class="layui-form" >
    <div class="layui-form-item">
        <label class="layui-form-label">部门编号</label>
        <div class="layui-input-block">
            <input type="text" name="did" lay-verify="did" autocomplete="off" placeholder="" class="layui-input"  value="${dept.did}"   style="height: 31px;width: 417px;" readonly>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">部门名称</label>
        <div class="layui-input-block">
            <input type="text" name="dname" lay-verify="dname" autocomplete="off" placeholder="请输入部门名称" class="layui-input"  value="${dept.dname}"   style="height: 31px;width: 417px;">
        </div>
    </div>
</form>
<div class="layui-form-item">
    <div class="layui-input-block">
        <button class="layui-btn" id="submitBtn" lay-submit="" lay-filter="demo1">立即提交</button>
        <button  id="r1" type="reset" class="layui-btn layui-btn-primary"  >重置</button>
    </div>
</div>
</body>


<script>
    layui.use(['form', 'layedit', 'laydate','jquery'], function(){
        var form = layui.form
            ,layer = layui.layer
            ,layedit = layui.layedit
            ,laydate = layui.laydate
            ,$=layui.jquery;

        /* 表单序列化*/
        $("#submitBtn").click(function(){
            var params=$("#myform").serialize();
            $.post("/dept/update",params,function(obj)
            {
                if (obj.message>0)
                {

                    var index=parent.layer.getFrameIndex(window.name);//查询出窗口的索引
                    parent.layer.close(index);//关闭该索引的窗口
                    parent.layer.msg("修改成功");
                }
                else{
                    parent.layer.msg("修改失败");
                }

            },'json');
      })
    });

</script>

</html>
